<!DOCTYPE html>
<HTML>
<HEAD><meta name="viewport" content="width=device-width, initial-scale=1">
<Title>ChartViewer</Title>
<link type='text/css' rel='Stylesheet' href="maxchartapi.css" />
</HEAD>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">

<p class="heading0">ChartDirector 7.0 (Java Edition)</p>
<p class="heading1">ChartViewer</p>
<hr class="separator">
<div class="content">
The ChartViewer control is a SWING control for viewing ChartDirector charts. It is a subclass of the JLabel control. Apart from displaying the charts, its main functions are to support advanced user interactions with the charts, including:<br><br>
<ul>
<li><b>Hot Spot Support</b><br><br>
The ChartViewer control displays tooltips and fires "hot spot mouse events" for hot spots when the mouse is moving or clicking on the hot spot. In the event handler, it provides information about the hot spot that triggers the event.<br><br>
The hot spots, with attributes and tool tips, are defined using standard HTML image map format. The <a href="BaseChart.getHTMLImageMap.htm">BaseChart.getHTMLImageMap</a> method can be used to automatically generate image maps for charts. You may also add your own custom hot spots by appending additional image map to the image map generated by BaseChart.getHTMLImageMap.<br><br>
<li><b>Programmable Track Cursor Support</b><br><br>
The ChartViewer control includes special methods and events for supporting programmable track cursors. It also manages the dynamic layer for drawing track cursors and other dynamic contents on the chart image.<br><br>
<li><b>Zoom and Scroll Support</b><br><br>
The ChartViewer control includes special methods and events for supporting using mouse clicks and drags to control the "viewport". There are also methods for synchronizing the axis scales with the viewport.<br></ul>
</div><p class="heading2">ChartViewer Members</p><div class="content">
The followings are members specific to the ChartViewer control. Members inherited from the JLabel control are omitted. Please refer to Java  documentation for members of the JLabel control.
<br><br>
<div style="width:100%;box-sizing:border-box;">
<table border="1" cellpadding="5" cellspacing="0" width="100%"> 
<tr>
<th width="19%">Method</th><th width="19%">Inherited</th><th>Description</th>
</tr>
<tr>
<td><a href="ChartViewer.ChartViewer.htm">ChartViewer</a></td><td>(Self)</td><td>Constructor for the ChartViewer component.</td></tr><tr><td><a href="ChartViewer.setChart.htm">setChart</a></td><td>(Self)</td><td>Sets a <a href="BaseChart.htm">BaseChart</a> object for display.</td></tr><tr><td><a href="ChartViewer.getChart.htm">getChart</a></td><td>(Self)</td><td>Gets the <a href="BaseChart.htm">BaseChart</a> pointer provided by the previous <a href="ChartViewer.setChart.htm">ChartViewer.setChart</a> method call.</td></tr><tr><td><a href="ChartViewer.setImage.htm">setImage</a></td><td>(Self)</td><td>Sets the chart image to view.</td></tr><tr><td><a href="ChartViewer.getImage.htm">getImage</a></td><td>(Self)</td><td>Gets the chart image that is being viewed.</td></tr><tr><td><a href="ChartViewer.setImageMap.htm">setImageMap</a></td><td>(Self)</td><td>Sets the image map that defines the hot spots on the chart image.</td></tr><tr><td><a href="ChartViewer.getImageMap.htm">getImageMap</a></td><td>(Self)</td><td>Gets the image map that is currently in use for defining the hot spots.</td></tr><tr><td><a href="ChartViewer.disposeReference.htm">disposeReference</a></td><td>(Self)</td><td>Remove the stored reference to the <a href="BaseChart.htm">BaseChart</a> object and image map string set using <a href="ChartViewer.setChart.htm">ChartViewer.setChart</a> and <a href="ChartViewer.setImageMap.htm">ChartViewer.setImageMap</a>.</td></tr><tr><td><a href="ChartViewer.getChartMouseX.htm">getChartMouseX</a></td><td>(Self)</td><td>Gets the mouse  x-coordinate in the chart pixel coordinate system.</td></tr><tr><td><a href="ChartViewer.getChartMouseY.htm">getChartMouseY</a></td><td>(Self)</td><td>Gets the mouse  y-coordinate in the chart pixel coordinate system.</td></tr><tr><td><a href="ChartViewer.getPlotAreaMouseX.htm">getPlotAreaMouseX</a></td><td>(Self)</td><td>Gets the mouse  x-coordinate on the plot area in the chart pixel coordinate system.</td></tr><tr><td><a href="ChartViewer.getPlotAreaMouseY.htm">getPlotAreaMouseY</a></td><td>(Self)</td><td>Gets the mouse  y-coordinate on the plot area in the chart pixel coordinate system.</td></tr><tr><td><a href="ChartViewer.setPlotAreaMouseMargin.htm">setPlotAreaMouseMargin</a></td><td>(Self)</td><td>Sets all margins (left, right, top, and bottom) of the plot area mouse event region to the same value.</td></tr><tr><td><a href="ChartViewer.setPlotAreaMouseMargin2.htm">setPlotAreaMouseMargin2</a></td><td>(Self)</td><td>Sets the margins of the plot area mouse event region.</td></tr><tr><td><a href="ChartViewer.removeDynamicLayer.htm">removeDynamicLayer</a></td><td>(Self)</td><td>Calls <a href="BaseChart.removeDynamicLayer.htm">BaseChart.removeDynamicLayer</a> when the specified event occurs.</td></tr><tr><td><a href="ChartViewer.updateDisplay.htm">updateDisplay</a></td><td>(Self)</td><td>Updates the display.</td></tr><tr><td><a href="ChartViewer.setViewPortLeft.htm">setViewPortLeft</a></td><td>(Self)</td><td>Sets the position of the left side of the viewport.</td></tr><tr><td><a href="ChartViewer.getViewPortLeft.htm">getViewPortLeft</a></td><td>(Self)</td><td>Gets the position of the left side of the viewport.</td></tr><tr><td><a href="ChartViewer.setViewPortTop.htm">setViewPortTop</a></td><td>(Self)</td><td>Sets the position of the top side of the viewport.</td></tr><tr><td><a href="ChartViewer.getViewPortTop.htm">getViewPortTop</a></td><td>(Self)</td><td>Gets the position of the top side of the viewport.</td></tr><tr><td><a href="ChartViewer.setViewPortWidth.htm">setViewPortWidth</a></td><td>(Self)</td><td>Sets the width of the viewport.</td></tr><tr><td><a href="ChartViewer.getViewPortWidth.htm">getViewPortWidth</a></td><td>(Self)</td><td>Gets the width of the viewport.</td></tr><tr><td><a href="ChartViewer.setViewPortHeight.htm">setViewPortHeight</a></td><td>(Self)</td><td>Sets the height of the viewport.</td></tr><tr><td><a href="ChartViewer.getViewPortHeight.htm">getViewPortHeight</a></td><td>(Self)</td><td>Gets the height of the viewport.</td></tr><tr><td><a href="ChartViewer.validateViewPort.htm">validateViewPort</a></td><td>(Self)</td><td>Ensures the viewport left, top, width and height are within valid ranges and adjusts them if necessary.</td></tr><tr><td><a href="ChartViewer.updateViewPort.htm">updateViewPort</a></td><td>(Self)</td><td>Triggers the ViewPortChanged event.</td></tr><tr><td><a href="ChartViewer.setFullRange.htm">setFullRange</a></td><td>(Self)</td><td>Defines the full range of a viewport data scale.</td></tr><tr><td><a href="ChartViewer.updateFullRangeH.htm">updateFullRangeH</a></td><td>(Self)</td><td>Updates the full range of a horizontal viewport data scale.</td></tr><tr><td><a href="ChartViewer.updateFullRangeV.htm">updateFullRangeV</a></td><td>(Self)</td><td>Updates the full range of a vertical viewport data scale.</td></tr><tr><td><a href="ChartViewer.getValueAtViewPort.htm">getValueAtViewPort</a></td><td>(Self)</td><td>Converts a viewport coordinate to a value of the specified data scale.</td></tr><tr><td><a href="ChartViewer.getViewPortAtValue.htm">getViewPortAtValue</a></td><td>(Self)</td><td>Converts a value of the specified data scale to a viewport coordinate.</td></tr><tr><td><a href="ChartViewer.syncLinearAxisWithViewPort.htm">syncLinearAxisWithViewPort</a></td><td>(Self)</td><td>Synchronizes a linear <a href="Axis.htm">Axis</a> with the part of the data scale in viewport.</td></tr><tr><td><a href="ChartViewer.syncLogAxisWithViewPort.htm">syncLogAxisWithViewPort</a></td><td>(Self)</td><td>Synchronizes a logarithmic <a href="Axis.htm">Axis</a> with the part of the data scale in viewport.</td></tr><tr><td><a href="ChartViewer.syncDateAxisWithViewPort.htm">syncDateAxisWithViewPort</a></td><td>(Self)</td><td>Synchronizes a date/time <a href="Axis.htm">Axis</a> with the part of the data scale in viewport.</td></tr><tr><td><a href="ChartViewer.setMouseUsage.htm">setMouseUsage</a></td><td>(Self)</td><td>Sets the mouse usage mode.</td></tr><tr><td><a href="ChartViewer.getMouseUsage.htm">getMouseUsage</a></td><td>(Self)</td><td>Gets the mouse usage mode.</td></tr><tr><td><a href="ChartViewer.setZoomDirection.htm">setZoomDirection</a></td><td>(Self)</td><td>Sets the zoom direction for mouse zoom in/out actions.</td></tr><tr><td><a href="ChartViewer.getZoomDirection.htm">getZoomDirection</a></td><td>(Self)</td><td>Gets the zoom direction for mouse zoom in/out actions.</td></tr><tr><td><a href="ChartViewer.setScrollDirection.htm">setScrollDirection</a></td><td>(Self)</td><td>Sets the scroll direction for mouse scroll actions.</td></tr><tr><td><a href="ChartViewer.getScrollDirection.htm">getScrollDirection</a></td><td>(Self)</td><td>Gets the scroll direction for mouse scroll actions.</td></tr><tr><td><a href="ChartViewer.setZoomInRatio.htm">setZoomInRatio</a></td><td>(Self)</td><td>Sets the magnification ratio for each zoom in click of the mouse.</td></tr><tr><td><a href="ChartViewer.getZoomInRatio.htm">getZoomInRatio</a></td><td>(Self)</td><td>Gets the magnification ratio for each zoom in click of the mouse.</td></tr><tr><td><a href="ChartViewer.setZoomOutRatio.htm">setZoomOutRatio</a></td><td>(Self)</td><td>Sets the magnification ratio for each zoom out click of the mouse.</td></tr><tr><td><a href="ChartViewer.getZoomOutRatio.htm">getZoomOutRatio</a></td><td>(Self)</td><td>Gets the magnification ratio for each zoom out click of the mouse.</td></tr><tr><td><a href="ChartViewer.setMouseWheelZoomRatio.htm">setMouseWheelZoomRatio</a></td><td>(Self)</td><td>Sets the magnification ratio for each mouse wheel event.</td></tr><tr><td><a href="ChartViewer.getMouseWheelZoomRatio.htm">getMouseWheelZoomRatio</a></td><td>(Self)</td><td>Gets the magnification ratio for each mouse wheel event.</td></tr><tr><td><a href="ChartViewer.setZoomInWidthLimit.htm">setZoomInWidthLimit</a></td><td>(Self)</td><td>Sets the viewport width at maximum zoom in.</td></tr><tr><td><a href="ChartViewer.getZoomInWidthLimit.htm">getZoomInWidthLimit</a></td><td>(Self)</td><td>Gets the viewport width at maximum zoom in for mouse zoom in actions.</td></tr><tr><td><a href="ChartViewer.setZoomOutWidthLimit.htm">setZoomOutWidthLimit</a></td><td>(Self)</td><td>Sets the viewport width at maximum zoom out.</td></tr><tr><td><a href="ChartViewer.getZoomOutWidthLimit.htm">getZoomOutWidthLimit</a></td><td>(Self)</td><td>Gets the viewport width at maximum zoom out for mouse zoom out actions.</td></tr><tr><td><a href="ChartViewer.setZoomInHeightLimit.htm">setZoomInHeightLimit</a></td><td>(Self)</td><td>Sets the viewport height at maximum zoom in.</td></tr><tr><td><a href="ChartViewer.getZoomInHeightLimit.htm">getZoomInHeightLimit</a></td><td>(Self)</td><td>Gets the viewport height at maximum zoom in for mouse zoom in actions.</td></tr><tr><td><a href="ChartViewer.setZoomOutHeightLimit.htm">setZoomOutHeightLimit</a></td><td>(Self)</td><td>Sets the viewport height at maximum zoom out.</td></tr><tr><td><a href="ChartViewer.getZoomOutHeightLimit.htm">getZoomOutHeightLimit</a></td><td>(Self)</td><td>Gets the viewport height at maximum zoom out for mouse zoom out actions.</td></tr><tr><td><a href="ChartViewer.setMinimumDrag.htm">setMinimumDrag</a></td><td>(Self)</td><td>Sets the minimum mouse drag distance before it is considered as an intentional drag.</td></tr><tr><td><a href="ChartViewer.getMinimumDrag.htm">getMinimumDrag</a></td><td>(Self)</td><td>Gets the minimum mouse drag distance before it is considered as an intentional drag.</td></tr><tr><td><a href="ChartViewer.setSelectionBorderWidth.htm">setSelectionBorderWidth</a></td><td>(Self)</td><td>Sets the border width of the zoom selection box.</td></tr><tr><td><a href="ChartViewer.getSelectionBorderWidth.htm">getSelectionBorderWidth</a></td><td>(Self)</td><td>Gets the border width of the zoom selection box.</td></tr><tr><td><a href="ChartViewer.setSelectionBorderColor.htm">setSelectionBorderColor</a></td><td>(Self)</td><td>Sets the border color of the zoom selection box as a java.awt.Color.</td></tr><tr><td><a href="ChartViewer.getSelectionBorderColor.htm">getSelectionBorderColor</a></td><td>(Self)</td><td>Gets the border color of the zoom selection box.</td></tr><tr><td><a href="ChartViewer.setHotSpotCursor.htm">setHotSpotCursor</a></td><td>(Self)</td><td>Sets the cursor that is displayed when the mouse cursor is over a normal hot spot.</td></tr><tr><td><a href="ChartViewer.getHotSpotCursor.htm">getHotSpotCursor</a></td><td>(Self)</td><td>Gets the cursor that is displayed when the mouse cursor is over a normal hot spot.</td></tr><tr><td><a href="ChartViewer.setZoomInCursor.htm">setZoomInCursor</a></td><td>(Self)</td><td>Sets the mouse cursor to be used when the mouse is used for zoom in.</td></tr><tr><td><a href="ChartViewer.getZoomInCursor.htm">getZoomInCursor</a></td><td>(Self)</td><td>Gets the mouse cursor to be used when the mouse is used for zoom in.</td></tr><tr><td><a href="ChartViewer.setZoomOutCursor.htm">setZoomOutCursor</a></td><td>(Self)</td><td>Sets the mouse cursor to be used when the mouse is used for zoom out.</td></tr><tr><td><a href="ChartViewer.getZoomOutCursor.htm">getZoomOutCursor</a></td><td>(Self)</td><td>Gets the mouse cursor to be used when the mouse is used for zoom out.</td></tr><tr><td><a href="ChartViewer.setNoZoomCursor.htm">setNoZoomCursor</a></td><td>(Self)</td><td>Sets the mouse cursor to be used when the mouse is used for zoom in/out, but the zoom in/out limits has been reached.</td></tr><tr><td><a href="ChartViewer.getNoZoomCursor.htm">getNoZoomCursor</a></td><td>(Self)</td><td>Gets the mouse cursor to be used when the mouse is used for zoom in/out, but the zoom in/out limits has been reached.</td></tr><tr><td><a href="ChartViewer.setScrollCursor.htm">setScrollCursor</a></td><td>(Self)</td><td>Sets the mouse cursor to be used when the mouse is used for scrolling.</td></tr><tr><td><a href="ChartViewer.getScrollCursor.htm">getScrollCursor</a></td><td>(Self)</td><td>Gets the mouse cursor to be used when the mouse is used for scrolling.</td></tr><tr><td><a href="ChartViewer.setUpdateInterval.htm">setUpdateInterval</a></td><td>(Self)</td><td>Sets the minimum gap interval between two ViewPortChanged events in milliseconds.</td></tr><tr><td><a href="ChartViewer.getUpdateInterval.htm">getUpdateInterval</a></td><td>(Self)</td><td>Gets the minimum gap interval between two ViewPortChanged events in milliseconds.</td></tr><tr><td><a href="ChartViewer.addTrackCursorListener.htm">addTrackCursorListener</a></td><td>(Self)</td><td>Adds the specified <a href="TrackCursorListener.htm">TrackCursorListener</a> to receive track cursor related events.</td></tr><tr><td><a href="ChartViewer.removeTrackCursorListener.htm">removeTrackCursorListener</a></td><td>(Self)</td><td>Remove the specified <a href="TrackCursorListener.htm">TrackCursorListener</a> so that it no longer receives track cursor related events.</td></tr><tr><td><a href="ChartViewer.addHotSpotListener.htm">addHotSpotListener</a></td><td>(Self)</td><td>Adds the specified <a href="HotSpotListener.htm">HotSpotListener</a> to receive hot spot mouse events.</td></tr><tr><td><a href="ChartViewer.removeHotSpotListener.htm">removeHotSpotListener</a></td><td>(Self)</td><td>Remove the specified <a href="HotSpotListener.htm">HotSpotListener</a> so that it no longer receives hot spot mouse events.</td></tr><tr><td><a href="ChartViewer.addHotSpotMotionListener.htm">addHotSpotMotionListener</a></td><td>(Self)</td><td>Adds the specified <a href="HotSpotMotionListener.htm">HotSpotMotionListener</a> to receive hot spot mouse motion events.</td></tr><tr><td><a href="ChartViewer.removeHotSpotMotionListener.htm">removeHotSpotMotionListener</a></td><td>(Self)</td><td>Remove the specified <a href="HotSpotMotionListener.htm">HotSpotMotionListener</a> so that it no longer receives hot spot mouse motion events.</td></tr><tr><td><a href="ChartViewer.addViewPortListener.htm">addViewPortListener</a></td><td>(Self)</td><td>Adds the specified <a href="ViewPortListener.htm">ViewPortListener</a> to receive viewport events.</td></tr><tr><td><a href="ChartViewer.removeViewPortListener.htm">removeViewPortListener</a></td><td>(Self)</td><td>Remove the specified <a href="ViewPortListener.htm">ViewPortListener</a> so that it no longer receives viewport events.</td></tr><tr><td><a href="ChartViewer.processHotSpotEvent.htm">processHotSpotEvent</a></td><td>(Self)</td><td>Process hot spot mouse events.</td></tr><tr><td><a href="ChartViewer.processHotSpotMotionEvent.htm">processHotSpotMotionEvent</a></td><td>(Self)</td><td>Process hot spot mouse motion events.</td></tr><tr><td><a href="ChartViewer.isMouseOnPlotArea.htm">isMouseOnPlotArea</a></td><td>(Self)</td><td>Checks if the mouse cursor is on the extended plot area.</td></tr><tr><td><a href="ChartViewer.isMouseDragging.htm">isMouseDragging</a></td><td>(Self)</td><td>Checks if the mouse is dragging on the plot area.</td></tr><tr><td><a href="ChartViewer.isInMouseMoveEvent.htm">isInMouseMoveEvent</a></td><td>(Self)</td><td>Checks if the current code is executing in a <a href="TrackCursorListener.mouseMovedChart.htm">TrackCursorListener.mouseMovedChart</a> event or <a href="TrackCursorListener.mouseMovedPlotArea.htm">TrackCursorListener.mouseMovedPlotArea</a> event handler.</td></tr><tr><td><a href="ChartViewer.isInViewPortChangedEvent.htm">isInViewPortChangedEvent</a></td><td>(Self)</td><td>Checks if the current code is executing in a ViewPortChanged event.</td></tr><tr><td colspan="3" bgColor="#cccccc">Note: Methods inherited from JLabel are omitted.</td></tr>
</tr>
</table>
</div>

</div>
<hr class="separator"><div class="copyright">&copy; 2022 Advanced Software Engineering Limited. All rights reserved.</div>
</body>
</HTML>
